import com.troyworks.framework.ui.BaseComponent;
/**
 * When used in conjunction with the MixinPlayer and MCLoader
 * provides a visual status of the load state.
 * @author Troy Gardner
 */
class com.troyworks.framework.ui.MCLoadingPercentIndicator extends BaseComponent{
	
	public var error_mc:MovieClip;
	public var percent_loaded_mc:MovieClip;
	public var percent_total_mc:MovieClip;
	
	public function onLoad():Void{
		error_mc._visible = false;
		percent_loaded_mc._visible = false;
		//percent_total_mc._visible = false;
		stop();
	}
	public function gotoLoadingPercent (p:Number):Void{
	trace("***********************************");
		trace("************** LOADING P " + p + " *********************");
			trace("***********************************");
				trace("***********************************");
	if(p == -1){
		error_mc._visible = true;
	}else if(p>= 100){
		gotoAndPlay("loadingComplete");
	}else{
		percent_loaded_mc._visible = true;
		percent_total_mc._visible = true;
		percent_loaded_mc._width = p;
	}
	}
}